<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
	<head>
		<title>${title}</title>
		<meta charset="utf-8">
		<#include "common/reference.ftl" />
		<#include "common/am.reference.ftl" />
	</head>
	<body class="${configs["skinName"]}">
		<div class="page-content">
			<div class="row">
			<#if viewMode !="view">
			<#include "common/breadcrumb.ftl">
			</#if>
				<form id="form" role="form" class="form-horizontal" method="post" action="${base}/${form_action}">
					<div class="col-xs-12">
						<div class="widget-box">
							<div class="widget-body">
								<input type="hidden" name="id" id="id" value="${model.id}" <#if viewMode == "view">disabled</#if>>
								<#if viewMode == "view">
								<div class="widget-header widget-header-flat">
									<h5 class="lighter">
										${module}
									</h5>
								</div>
								<#else>
								<div class="alert alert-warning">
									<strong>提示!</strong>
									<strong style="color:#dd514c;">出现红框</strong>的表示不能为空
								</div>
								</#if>
								<div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        行政区划
                                    </label>
                                    <div class="col-sm-6">
                                        <select id="address" name="address" class="chosen-select form-control" required data-placeholder="请选择行政区划" <#if viewMode == "view">disabled</#if>>
                                            <option value="">请选择行政区划</option>
                                            <#if areaList?exists && areaList?size gt 0>
                                            <#list areaList as item>
                                            <option value="${item.areaCode}"<#if model.address == item.areaCode>selected</#if> >${item.areaName}</option>
                                            </#list>
                                            </#if>
                                        </select>
                                        <input type="hidden" name="areaName" value="${model.areaName}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        所属公司
                                    </label>
                                    <div class="col-sm-6">
                                        <select id="companyId" name="companyId" class="chosen-select form-control" required data-placeholder="请选择所属分公司" <#if viewMode == "view">disabled</#if>>
                                            <option value="">请选择所属公司</option>
                                            <#if companyList?exists && companyList?size gt 0>
                                            <#list companyList as item>
                                            <option value="${item.companyId}"<#if model.companyId == item.companyId>selected</#if> >${item.ownerName}</option>
                                            </#list>
                                            </#if>
                                        </select>
                                        <input type="hidden" name="companyName" value="${model.companyName}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        服务业务
                                    </label>
                                    <div class="col-sm-6">
                                        <select id="serviceCode" name="serviceCode" class="select-chosen form-control" required <#if viewMode == "view">disabled</#if> >
                                            <option value="">请选择服务业务</option>
                                            <option value="01" <#if "01" == model.serviceCode>selected="selected"</#if> >快车</option>
                                            <option value="02" <#if "02" == model.serviceCode>selected="selected"</#if> >专车</option>
                                            <option value="03" <#if "03" == model.serviceCode>selected="selected"</#if> >城际通</option>
                                        </select>
                                        <input type="hidden" name="serviceName" value="${model.serviceName}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        运价类型编码
                                    </label>
                                    <div class="col-sm-6">
                                        <input type="text" id="FareType" name="FareType" value="${model.getFareType()}" class="form-control" required placeholder="请输入运价类型编码">
                                        <span class="lbl">运价类型编码  用网约车平台公司统一编码，应保持唯一性</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        运价类型说明
                                    </label>
                                    <div class="col-sm-6">
                                        <input type="text" id="FareTypeNote" name="FareTypeNote" value="${model.getFareTypeNote()}" class="form-control"  placeholder="请输入运价类型说明">
                                        <span class="lbl"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        起步价
                                    </label>
                                    <div class="col-sm-6">
                                        <input type="number" id="StartFare" name="StartFare" value="${model.getStartFare()}" class="form-control" required placeholder="请输入起步价">
                                        <span class="lbl">起步价 单位：元</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        起步里程
                                    </label>
                                    <div class="col-sm-6">
                                        <input type="number" id="StartMile" name="StartMile" value="${model.getStartMile()}" class="form-control" required placeholder="请输入起步里程" >
                                        <span class="lbl">起步里程 单位：km</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        起步时间
                                    </label>
                                    <div class="col-sm-6">
                                        <input type="number" id="StartMinute" name="StartMinute" value="${model.getStartMinute()}" class="form-control" required placeholder="请输入起步时间" >
                                        <span class="lbl">起步时间 单位：分钟</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        计程单价（按公里）
                                    </label>
                                    <div class="col-sm-6">
                                        <input type="number" id="UnitPricePerMile" name="UnitPricePerMile" value="${model.getUnitPricePerMile()}" class="form-control" required placeholder="请输入计程单价（按公里）">
                                        <span class="lbl">计程单价（按公里） 单位：元</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        计时单价（按分钟）
                                    </label>
                                    <div class="col-sm-6">
                                        <input type="number" id="UnitPricePerMinute" name="UnitPricePerMinute" value="${model.getUnitPricePerMinute()}" class="form-control" required placeholder="请输入计时单价（按分钟）">
                                        <span class="lbl">计时单价（按分钟） 单位：元</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        平台收费比例
                                    </label>
                                    <div class="col-sm-6">
                                        <input type="number" id="chargeRatio" name="chargeRatio" value="${model.subChargeRatio}" class="form-control" required placeholder="请输入平台收费比例">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        分公司收费比例
                                    </label>
                                    <div class="col-sm-6">
                                        <input type="number" id="subChargeRatio" name="subChargeRatio" value="${model.subChargeRatio}" class="form-control" required placeholder="请输入分公司收费比例">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        是否启用
                                    </label>
                                    <div class="col-sm-6">
                                        <input class="ace ace-switch ace-switch-7" type="checkbox" name="enabled" <#if model == null || model.enabled>checked="checked"</#if> <#if viewMode == "view">disabled</#if>>
                                        <span class="lbl"></span>
                                    </div>
                                </div>
								<#if viewMode != "view">
								<div class="clearfix form-actions">
									<div class="col-md-offset-3 col-md-9">
										<button id="btnSubmit" class="btn btn-info" type="submit">
											<i class="fa fa-check bigger-110"></i>
											提 交
										</button>
									</div>
								</div>
								</#if>
							</div>
						</div>
					</div>
				</form>
			</div>	
		</div>
		<script type="text/javascript">
		$(function(){
		    $('#address').chosen();
            $('#address').change(function(){
                var address = $(this).val();
                var areaName = $(this).find('option[value="'+address+'"]').text();
                $('input[type="hidden"][name="areaName"]').val(areaName);
            });
            $('#areaName').trigger('change');

            $('#companyId').chosen();
            $('#companyId').change(function(){
                var companyId = $(this).val();
                var companyName = $(this).find('option[value="'+companyId+'"]').text();
                $('input[type="hidden"][name="companyName"]').val(companyName);
            });
            $('#companyName').trigger('change');

            $('#serviceCode').chosen();
            $('#serviceCode').change(function(){
                var serviceCode = $(this).val();
                var serviceName = $(this).find('option[value="'+serviceCode+'"]').text();
                $('input[type="hidden"][name="serviceName"]').val(serviceName);
            });
            $('#serviceName').trigger('change');

			$('.select-chosen').chosen();
			$('#form').validator();
		})
		</script>
	</body>
</html>